<?php

class Application_Model_DbTable_WishList extends Zend_Db_Table_Abstract
{

    protected $_name = 'wish_list';

	protected $primary = array('phone_id', 'customer_id');
	
	protected $_referenceMap = array(
			'Phone'	=> array(
				'columns'		=> 'phone_id',
				'refTableClass' => 'Application_Model_DbTable_Phone',
				'refColumns'	=> 'id'
			),
			'Customer' => array(
				'columns'		=> 'customer_id',
				'refTableClass'	=> 'Application_Model_DbTable_Customer',
				'refColumns'	=> 'id'
			)
	);
	
	public function isAdded($customerId, $productId) {
		$rs = $this->find($productId, $customerId );
		
		return $rs->count() > 0;
	}
}

